<?php
/* 
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
class Marketplace_Component_Block_Media_Photo extends Phpfox_Component
{
    public function process(){
        $aImages = Phpfox::getService("link")->getImages($this->getParam("link"));
        $sType = $this->getParam("albumType","marketplace");
        if($sType == "marketplace"){
            $aAlbums = Phpfox::getService("marketplace.store.album")->get(Phpfox::getUserId());
        }
        else{
            $aAlbums = Phpfox::getService('photo.album')->getAll(Phpfox::getUserId());
            foreach($aAlbums as $iKey => $aAl){
                $aAlbums[$iKey]["title"] = $aAl['name'];
            }
        }
        if(!$aImages){
            return false;
        }
        $this->template()->assign(array(
            "aImages" => $aImages,
            "aAlbums" => $aAlbums,
            "sAlbumType" => $sType
        ));
    }
}

?>
